public with sharing class CampaignVisualization {
	private transient Map<Id,Campaign> mapCampaigns{get;set;}
	//public transient Map<Id,ChartData> mapChartData{get;set;}
	public List<ChartData> lChartData{get;set;}
	
	//Constructor
	public CampaignVisualization(){
		mapCampaigns = new Map<Id,Campaign>();
		mapCampaigns = getCampaigns();
		lChartData = new List<ChartData>();
		
		mapCampaigns = getCampaigns();
		
		for(Campaign c : mapCampaigns.values()){
			System.debug(''+c.EndDate);
			lChartData.add(new ChartData(c.Name,c.Status,c.StartDate,c.EndDate,c.StartDate.daysBetween(c.EndDate)));
		}
		
		
	}//CampaignVisualization()
	
	private Map<Id,Campaign> getCampaigns(){
		Map<Id,Campaign> result;
		return result = new Map<Id,Campaign>([SELECT Status, StartDate, Name, EndDate FROM Campaign LIMIT 1]);
	}//END getCampaigns()
	
	public Class ChartData{
		public string sName{get;set;}
		public string sStatus{get;set;}
		public Date dStartDate{get;set;}
		public Date dEndDate{get;set;}
		public integer iRunningDays{get;set;}
		
		//Contructor
		public ChartData(String sName,String sStatus,Date dStartDate,Date dEndDate,integer iRunningDays){
			this.sName = sName;
			this.sStatus = sStatus;
			this.dStartDate = dStartDate;
			this.dEndDate = dEndDate;
			this.iRunningDays = iRunningDays;
		}//END public ChartData()
		
	}//END private Class ChartData

}